// ConvertUnits.h: interface for the ConvertUnits class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CONVERTUNITS_H__A5B4A211_6CD0_4648_B969_8328A9248060__INCLUDED_)
#define AFX_CONVERTUNITS_H__A5B4A211_6CD0_4648_B969_8328A9248060__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class ConvertUnits  
{
public:
    int UnitsConvert(CString &PSAUnits,CString &PDUnits);
public:
	_ConnectionPtr m_pCon;
public:
	void InitUnits(CString UnitsFieldsName, CString UnitsFieldsScale, CString UnitsFieldsOffset);
	float ConvertValue(float& sourceValue,int i=-1);

private:
	float m_fPDScale;
	float m_fPSAScale;
	float m_fOffsetPD;
	float m_fOffsetPSA;
public:
    ConvertUnits();
	virtual ~ConvertUnits();
private:
	CString m_UnitsFieldsOffset;
	CString m_UnitsFieldsScale;
	CString m_UnitsFieldsName;
    int GetParameters(_RecordsetPtr &pRs,CString& Units, float& fOffset,float& fScale);
};

#endif // !defined(AFX_CONVERTUNITS_H__A5B4A211_6CD0_4648_B969_8328A9248060__INCLUDED_)
